home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 June / EnigmA AMIGA RUN 19 (1997)(G.R. Edizioni)(IT)[!][issue 1997-06][EAR-CD III].iso / recent1 / apic1805.lha / APIC / examples / simple.lst < prev   
File List  |  1997-05-18  |  3KB  |  86 lines

  1. #PIC V0.9.2 (c)1997 J.Petroglou    LIST FILE
  2. #file: data:aminetupp/PICSim/examples/simple.asm
  3. #date: Sat May 10 14:55:39 1997
  4. #pic : PIC16C54
  5.  
  6. ADDR CODE     SRCLINE SOURCECODE
  7.  
  8. 0000             000001 ;this is a simple source
  9. 0000             000002 ;
  10. 0000             000003 ;this little program toggles the PortA bit 3,
  11. 0000             000004 ;Port B counts every change on bit RA.3
  12. 0000             000005 ;
  13. 0000             000006 
  14. 0000             000007 
  15. 0000             000008 
  16. 0000             000009     list    p=PIC16C54, r=dec, s=off
  17. 0000             000010 
  18. 0000             000011 
  19. 01FF             000012     org    1ffh
  20. 01FF 0A00        000013     goto    start
  21. 0000             000014     org    0
  22. 0000             000015 
  23. 0000             000016 
  24. 0000             000017 
  25. 0000             000018 count1    =    0Bh            ;this assigns the symbol to the register 
  26. 0000             000019 
  27. 0000             000020 RA    =    5            ;PortA is register 5
  28. 0000             000021 RB    =    6            ;PortB is register 6
  29. 0000             000022 
  30. 0000             000023 
  31. 0000             000024 
  32. 0000 0C07        000025 start    movlw    00000111b    
  33. 0001 0005        000026     tris    RA            ;bit 0 to bit 2 are inputs
  34. 0002             000027 
  35. 0002 0C00        000028     movlw    0            ;portb is output
  36. 0003 0006        000029     tris    RB
  37. 0004             000030 
  38. 0004 0066        000031     clrf    RB,f            ;clear PortB
  39. 0005             000032 
  40. 0005 0C08        000033 main    movlw    00001000b
  41. 0006 01A5        000034     xorwf    RA            ;toggle bit 3 from PortA
  42. 0007             000035 
  43. 0007 02A6        000036     incf    RB,f            ;increase PortB
  44. 0008             000037 
  45. 0008 090A        000038     call    delay
  46. 0009             000039 
  47. 0009 0A05        000040     goto    main            ;do the main loop
  48. 000A             000041 
  49. 000A             000042 
  50. 000A             000043 
  51. 000A             000044 
  52. 000A 0C14        000045 delay    movlw    20
  53. 000B 002B        000046     movwf    count1            ;mov 20 to count1
  54. 000C             000047 
  55. 000C 02EB        000048 :loop    decfsz    count1
  56. 000D 0A0C        000049     goto    :loop            ;decrement count1 and jump to local symbol until
  57. 000E             000050                     ;loop is > 0
  58. 000E 0800        000051     retlw    0
  59.  
  60.  
  61. Used Symbols
  62. -----------------------------------------
  63. count1                           0000000B
  64. RA                               00000005
  65. RB                               00000006
  66. start                            00000000
  67. main                             00000005
  68. delay                            0000000A
  69.  
  70.  
  71. PROGRAM MEMORY USAGE TABLE:    '-' = not used  'X' = used
  72.  
  73. 0000 : XXXXXXXXXXXXXXX- ---------------- ---------------- ----------------
  74. 0040 : ---------------- ---------------- ---------------- ----------------
  75. 0080 : ---------------- ---------------- ---------------- ----------------
  76. 00C0 : ---------------- ---------------- ---------------- ----------------
  77. 0100 : ---------------- ---------------- ---------------- ----------------
  78. 0140 : ---------------- ---------------- ---------------- ----------------
  79. 0180 : ---------------- ---------------- ---------------- ----------------
  80. 01C0 : ---------------- ---------------- ---------------- ---------------X
  81.  
  82. Program Memory Words Used:  0016
  83. Program Memory Words Free:  0496
  84.  
  85. Errors: 0
  86.